home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / pst10a.zip / PST.EXE / ABOUT / 101
Text File  |  1996-06-03  |  7KB  |  117 lines

  1. *********************************************
  2. * Programmers String Tool(PST) Version 1.0a *
  3. * Copyright(C) 1996, Luke S. Tomasello.     *
  4. *********************************************
  5.     
  6. If you have questions or suggestions you can contact me on the Internet at:
  7. 102620.1554@compuserve.com
  8.  
  9. *********
  10.  *** LEGAL
  11. *********
  12.  
  13. The author makes NO WARRANTY or representation, either express or implied, with respect to this software, its quality, accuracy, merchantability, or fitness for a particular purpose.  This software is provided "AS IS", and you, its user, assume the entire risk as to its quality and accuracy.
  14.  
  15. Permission for use of this software is granted only if the user accepts full responsibility for any undesirable consequences; the author accepts NO LIABILITY for damages of any kind.
  16.  
  17. This software is copyright (C) 1996, Luke S. Tomasello.
  18. All Rights Reserved.
  19.  
  20. *********
  21.  *** COMMANDS 
  22. *********
  23.  
  24. Usage: Pst [-abcfhqs] match_text [replacement_text] file1 [file2...]
  25.  
  26. -a ............... About. (Use -Ar for unformatted output.)
  27. This switch displays this document. This document gives copyright, usage and other information about Pst. The -a switch does simple text formatting to your screen. If you wish to print this document I suggest dumping the document to a text file then printing it from your favorite word processor. To dump this document to a file in raw format, do the following:
  28. Pst -Ar > myfile.txt
  29.  
  30. -b ............... Leave backup files
  31. This switch leaves backup files just in case you change your mind.
  32. Backup files keep the same name as the input file and only change the extension to .~nn where nn is a hexadecimal number in the range 00-64.
  33. For example, say you run Pst on Myfile.cpp and Myfile.h. The Pst backup files would be Myfile.~00 and Myfile.~01 respectively.
  34. The Backup option is limited to 100 (64h) unique extensions for backup files with the same name.
  35.  
  36. -c ............... Ignore case
  37. When the Ignore Case options is enabled, text with differing case still match. For example "CAT" would match "cat" and "Cat".
  38.  
  39. -f ............... Find but don't replace strings
  40. The Find option is used to locate Tokens in a text file. The Tokens mentioned here have all of the same characteristics as the Tokens in replace mode.
  41. See Also: "WHAT IS A TOKEN?"
  42.  
  43. -h ............... Command summary
  44. The Help option displays a short command summary screen.
  45.  
  46. -p ............... Preserve mixed case format
  47. Preserve the mixed case nature of the matched string.
  48. Note: -p implies -c.
  49. Here are some examples of what Pst does.
  50. If you were to specify: Pst -p "myfile" "YourFile" *.cpp
  51. If Pst found "myfile", Pst would replace it with "yourfile"
  52. If Pst found "MYFILE", Pst would replace it with "YOURFILE"
  53. If Pst found "MyFile", Pst would replace it with "YourFile"
  54. The rule is: If the found text is all lower case, the replace text is lower cased before the replacement. Else If the found text is all upper case, the replace text is upper cased before the replacement. Else the replacement text is used as is.
  55.  
  56. -q ............... Quite mode
  57. Quiet mode is useful for batch operation when a bunch of blather is not useful. It is also useful to note that output is slow. In one test I ran with hundreds of replacements over a couple dozen files, 54% of the running time was spent in the output routines! Usually this is not a problem, but it is good to know just the same.
  58.  
  59. -s ............... Replace substrings
  60. Don't be fooled, these substrings are substrings within Tokens and are not arbitrary. 
  61. For Example: If LONG_RETURN is a token then any substring of LONG_RETURN is valid. Eg. "LONG", "G_R", "RET", etc..
  62. Using substring replacements we could change:
  63. LONG_RETURN   ==> LONG_UNION
  64. SHORT_RETURN  ==> SHORT_UNION
  65. With the following Pst command:
  66. Pst -s _RETURN _UNION *.cpp
  67.  
  68. *********
  69.  *** WHEN AND WHY TO USE PST
  70. *********
  71.  
  72. Pst is a text processing tool used to to Locate and Replace text Tokens in text files (Usually program source code).
  73. Understanding Text Tokens is key to getting the most out of Pst.
  74.  
  75. WHAT IS A TOKEN?
  76. A Token is any string of one or more characters in the set [a-zA-Z0-9_]. 
  77. As far as Pst is concerned, there are only two things in a text file-tokens and delimiters. To Pst, delimiters are all things that are not Tokens.
  78.  
  79. HOW DOES IT WORK?
  80. Pst locates all of those things it considers Tokens then applies the transformations the user has specified.
  81.  
  82. IS IT USEFUL?
  83. This model while restrictive is also very powerful and intuitive. I have used several tools such as gres, sed, awk, etc. and found them complicated to use because of their generality. Pst on the other hand implements some of the more frequently used regular expressions 'internally' for text file translation thus simplifying the interface.
  84.  
  85. WHAT ABOUT SAFETY?
  86. Pst is very careful with "Our" input files.
  87. Pst was designed to preserve the original input file at all costs.
  88. Because Pst never opens the original input file for anything but read, Pst can gracefully report exceptions and continue with the next file in the input queue without ever endangering the original input file.
  89. Pst contains one small module called the critical_rename_service() This is the only code block that can cause data loss. If a failure happens in this module, the program will exit with a full explanation of where your original file is. (It may have already been renamed to something else.)
  90.  
  91. *********
  92.  *** REGISTERATION
  93. *********
  94.  
  95. Evaluation and Registration:
  96.  
  97. This is not free software.  You are hereby licensed to use this software for evaluation purposes without charge for a period of 21 days.  If you use this software after the 21 day evaluation period a registration fee of $8 is required. Payments must be in US dollars drawn on a US bank. Contact Luke S. Tomasello on the Internet at 102620.1554@compuserve.com for payment options. Quantity discounts are also available.  When payment is received you will receive a registered copy of the latest version of Pst.
  98.  
  99. Unregistered use of Pst after the 21-day evaluation period is in violation of U.S. and international copyright laws.
  100.  
  101. Distribution:
  102.  
  103. Provided that you verify that you are distributing the Shareware Version (run Pst -h to display whether Registered or Shareware) you are hereby licensed to make as many copies of the Shareware version of this software and documentation as you wish; give exact copies of the original Shareware version to anyone; and distribute the Shareware version of the software and documentation in its unmodified form via electronic means.  There is no charge for any of the above.  
  104.  
  105. You are specifically prohibited from charging, or requesting donations, for any such copies, however made; and from distributing the software and/or documentation with other products (commercial or otherwise) without prior written permission, with one exception:  Disk Vendors approved by the Association of Shareware Professionals are permitted to redistribute Pst, subject to the conditions in this license, without specific written permission.
  106.  
  107. Pst Single Copy            copies at $8 each
  108.  
  109. Pst Site License
  110.   2 to   9 computers:      computers at $7 each
  111.  10 to  24 computers:      computers at $6 each 
  112.  25 to  49 computers:      computers at $5 each 
  113.  50 to  99 computers:      computers at $4 each 
  114. 100 to 199 computers:      computers at $3 each
  115.  
  116.  
  117.